package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.event.EventListener;

/**
 * Spring Boot与Spring AI集成DeepSeek的主应用类
 * 
 * @author Spring AI Demo
 * @version 1.0.0
 */
@SpringBootApplication
public class DeepSeekApplication {

    public static void main(String[] args) {
        SpringApplication.run(DeepSeekApplication.class, args);
    }

    /**
     * 应用启动完成后的事件处理
     */
    @EventListener(ApplicationReadyEvent.class)
    public void onApplicationReady() {
        System.out.println("\n" +
                "=================================================================\n" +
                "🚀 Spring AI DeepSeek 演示应用启动成功！\n" +
                "=================================================================\n" +
                "📖 API文档地址：\n" +
                "   • 营销文案生成：POST http://localhost:8080/api/ai/marketing\n" +
                "   • 代码生成：    POST http://localhost:8080/api/ai/code\n" +
                "   • 智能问答：    POST http://localhost:8080/api/ai/qa\n" +
                "   • 聊天对话：    POST http://localhost:8080/api/ai/chat\n" +
                "   • 流式聊天：    GET  http://localhost:8080/api/stream/chat?message=你好\n" +
                "=================================================================\n" +
                "💡 使用提示：\n" +
                "   1. 请确保在application.yml中配置了有效的DeepSeek API密钥\n" +
                "   2. 或者设置环境变量：DEEPSEEK_API_KEY=your-api-key\n" +
                "   3. 访问 http://localhost:8080/actuator/health 检查应用健康状态\n" +
                "=================================================================\n");
    }
} 